<template>
  <div id="kefu">
    <img
      src="../assets/lianxiwomen.png"
      style="
        width: 95%;
        margin: 0 auto;
        display: block;
        height: 2rem;
        margin-bottom: 1rem;
      "
    />
    <div class="kefumaindov">
      <div class="kefumaindovleft">
        <div class="kefumaindovleftshutiao"></div>
        <p style="margin-left: 6%" class="titlep">{{ data1.name }}</p>
        <div
          style="
            flex: 1;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
          "
        >
          <div
            class="zonghekefu"
            v-for="(item, index) in data1.children"
            :key="item.id"
          >
            <p
              class="zonghekefutitle"
              :style="{
                'border-radius':
                  data1.children.length - 1 == index
                    ? '0 0.5rem 0.5rem 0.5rem'
                    : '',
              }"
            >
              {{ item.value.split(" ")[0] }}
            </p>
            <p>{{ item.value.split(" ")[1] }}</p>
          </div>
        </div>
      </div>
      <div class="kefumaindovmiddle">
        <p class="titlep">{{ data2.name }}</p>
        <div class="kuangdiv">
          <div class="kuangdivsmall">
            <p v-for="item in data2.children.slice(0, 5)" :key="item.id">
              {{ item.value }}
            </p>
          </div>
          <div class="kuangdivsmall" style="border-left: 0.05rem solid #182c56">
            <p v-for="item in data2.children.slice(5, 10)" :key="item.id">
              {{ item.value }}
            </p>
          </div>
          <div class="kuangdivsmall" style="border-left: 0.05rem solid #182c56">
            <p v-for="item in data2.children.slice(10, 15)" :key="item.id">
              {{ item.value }}
            </p>
          </div>
        </div>
      </div>
      <div class="kefumaindovright">
        <p class="titlep">{{ data3.name }}</p>
        <div class="kuangdiv">
          <div class="kuangdivsmall" style="width: 100%; flex-wrap: wrap">
            <p v-for="item in data3.children" :key="item.id">
              {{ item.value }}
            </p>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import APIS from "@/api/index";
// import { Message } from "element-ui";
export default {
  data() {
    return {
      data1: {},
      data2: {},
      data3: {},
    };
  },
  mounted() {
    this.getContact();
  },
  methods: {
    //结果发布列表
    getContact() {
      APIS.Homepage.getContact()
        .then((res) => {
          const data = res.data;
          this.data1 = data[0];
          this.data2 = data[1];
          this.data3 = data[2];
        })
        .catch((err) => {
          console.log(err);
        });
    },
  },
};
</script>

<style scoped>
#kefu {
  width: 95%;
  margin: 0 auto;
  margin-top: 2rem;
  text-align: left;
}
.kefumaindov {
  display: flex;
  justify-content: space-around;
  margin-top: 2%;
  margin-bottom: 2.5rem;
}
.kefumaindovleft {
  width: 15%;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
}
.kefumaindovleftshutiao {
  width: 0.1rem;
  height: 95%;
  position: absolute;
  top: 0;
  left: 0.1rem;
  background-color: #182c56;
}
.zonghekefutitle {
  padding-left: 3%;
  padding-right: 3%;
  background-color: #182c56;
  border-radius: 0 0.5rem 0.5rem 0;
  color: white;
  margin-right: 1%;
}
.kefumaindovright {
  width: 30%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.kefumaindovmiddle {
  width: 53%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.zonghekefu {
  font-size: 0.75rem;
  color: #000000;
  display: flex;
  padding: 1%;
}
.kuangdiv {
  border: 0.1rem solid #182c56;
  border-radius: 0.5rem 0.5rem 0.5rem 0.5rem;
  flex: 1;
  display: flex;
  justify-content: space-around;
}
.titlep {
  color: #182c56;
  margin-bottom: 0.5rem;
}
.kuangdivsmall {
  width: 33%;
  margin: 2%;
  font-size: 0.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-left: 1%;
}
</style>
